//
//  AY_ChannelModel.m
//  AiYue
//
//  Created by boWen on 2023/10/17.
//

#import "AY_ChannelModel.h"


@implementation SortModel
+ (JSONKeyMapper *)keyMapper{
    return [[JSONKeyMapper alloc]initWithModelToJSONDictionary:@{@"channelId":@"id"}];
}
@end

@implementation AY_titleSModel

@end




@implementation ChannelListModel
+ (JSONKeyMapper *)keyMapper{
    return [[JSONKeyMapper alloc]initWithModelToJSONDictionary:@{@"controlId":@"id",@"bookDescription":@"description",}];
}

- (instancetype)initWithDictionary:(NSDictionary *)dict error:(NSError *__autoreleasing *)err{
    self = [super initWithDictionary:dict error:err];
    if (self) {
        NSDictionary *dic1 = dict[@"displayStyle"];
        NSMutableArray *arr = dict[@"items"];
        NSMutableArray *arr1 = [NSMutableArray array];
        if ([dic1[@"styleCode"] isEqual:@"bd"]) {
            for (int i =0; i < arr.count; i++) {
                BookBDModel *decModel = [[BookBDModel alloc] initWithDictionary:arr[i] error:nil];
                [arr1 addObject:decModel];
            }
            self.bdItems = arr1.copy;
        }else {
            for (int i =0; i < arr.count; i++) {
                BookDecModel *decModel = [[BookDecModel alloc] initWithDictionary:arr[i] error:nil];
                [arr1 addObject:decModel];
            }
            self.items = arr1.copy;
        }
    }
    return self;
}
@end

@implementation AY_ChannelModel

@end

@implementation DisplayStyleModel

@end

@implementation BookDecModel
+ (JSONKeyMapper *)keyMapper{
    return [[JSONKeyMapper alloc]initWithModelToJSONDictionary:@{@"bookDecId":@"id",@"imagePic":@"image",}];
}
@end

@implementation AY_BookRefreshModel

@end

@implementation BookBDModel

@end

@implementation BookBDsModel
+ (JSONKeyMapper *)keyMapper{
    return [[JSONKeyMapper alloc]initWithModelToJSONDictionary:@{@"bookId":@"id"}];
}
@end


